//
// CLoadBalancingGroup.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CLoadBalancingGroup {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CLoadBalancingGroup(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CLoadBalancingGroup obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CLoadBalancingGroup(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setName(String value) {
    nel3dJNI.CLoadBalancingGroup_Name_set(swigCPtr, this, value);
  }

  public String getName() {
    return nel3dJNI.CLoadBalancingGroup_Name_get(swigCPtr, this);
  }

  public CLoadBalancingGroup() {
    this(nel3dJNI.new_CLoadBalancingGroup(), true);
  }

  public void setNbFaceWanted(long nFaces) {
    nel3dJNI.CLoadBalancingGroup_setNbFaceWanted(swigCPtr, this, nFaces);
  }

  public long getNbFaceWanted() {
    return nel3dJNI.CLoadBalancingGroup_getNbFaceWanted(swigCPtr, this);
  }

  public float getNbFaceAsked() {
    return nel3dJNI.CLoadBalancingGroup_getNbFaceAsked(swigCPtr, this);
  }

  public void addNbFacesPass0(float v) {
    nel3dJNI.CLoadBalancingGroup_addNbFacesPass0(swigCPtr, this, v);
  }

  public float computeModelNbFace(float faceIn) {
    return nel3dJNI.CLoadBalancingGroup_computeModelNbFace(swigCPtr, this, faceIn);
  }

  public final static class TPolygonBalancingMode {
    public final static TPolygonBalancingMode PolygonBalancingOff = new TPolygonBalancingMode("PolygonBalancingOff", nel3dJNI.CLoadBalancingGroup_PolygonBalancingOff_get());
    public final static TPolygonBalancingMode PolygonBalancingOn = new TPolygonBalancingMode("PolygonBalancingOn");
    public final static TPolygonBalancingMode PolygonBalancingClamp = new TPolygonBalancingMode("PolygonBalancingClamp");
    public final static TPolygonBalancingMode CountPolygonBalancing = new TPolygonBalancingMode("CountPolygonBalancing");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TPolygonBalancingMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TPolygonBalancingMode.class + " with value " + swigValue);
    }

    private TPolygonBalancingMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TPolygonBalancingMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TPolygonBalancingMode(String swigName, TPolygonBalancingMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TPolygonBalancingMode[] swigValues = { PolygonBalancingOff, PolygonBalancingOn, PolygonBalancingClamp, CountPolygonBalancing };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
